interface DataItem {
  dir: string
  time: string
  cover: string
  type: string
}

export const getDiffDataByTime = (newData: DataItem[], oldData: DataItem[]) => {
  const oldTimes = new Set(oldData.map((item) => item.time))
  const newTimes = new Set(newData.map((item) => item.time))

  // 新增：newData 中的 time 不在 oldData 中
  const added = newData.filter((item) => !oldTimes.has(item.time))

  // 删除：oldData 中的 time 不在 newData 中
  const deleted = oldData.filter((item) => !newTimes.has(item.time))

  return { added, deleted }
}
